package com.example.demo.enumTest;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @description 订单枚举
 *
 * @author lilinchun
 * @date 2023/11/03
 */
@Getter
@AllArgsConstructor
public enum OrderStatusEnum {

    /**
     * 订单未支付
     */
    UN_PAID("1", "订单未支付"),
    /**
     * 订单已支付
     */
    PAIDED("2", "订单已支付"),
    /**
     *订单已发货
     */
    SENDED("3", "订单已发货"),
    /**
     *订单已签收
     */
    SINGED("4", "订单已签收"),
    /**
     *订单已评价
     */
    EVALUATED("5", "订单已评价");

    private String status;

    private String statusDes;

    public static OrderStatusEnum of(String status) {
        for (OrderStatusEnum statusEnum : OrderStatusEnum.values()) {
            if (statusEnum.getStatus().equals(status)) {
                return statusEnum;
            }
        }
        return null;
    }

}
